Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for normalization of JSON objects in arrays to ensure all objects have a consistent schema. This allows querying JSON arrays where not all objects contain the same properties.
Key Changes:
- Introduced normalization utilities for both System.Text.Json and Newtonsoft.Json implementations
- Added
Normalizeproperty to configuration classes with default value oftrue - Added
NormalizationNonExistingPropertyBehaviorenum to control how missing properties are handled
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 25 comments.
Show a summary per file
| File | Description |
|---|---|
SystemTextJsonTests.cs |
Added tests for array normalization functionality and behavior when normalization is disabled |
NewtonsoftJsonTests.cs |
Added similar normalization tests and removed commented-out code |
NormalizeUtils.cs (SystemTextJson) |
Implements JSON array normalization logic with schema building and object normalization |
NormalizeUtils.cs (NewtonsoftJson) |
Parallel implementation for Newtonsoft.Json library |
SystemTextJsonParsingConfig.cs |
Added Normalize property and normalization behavior configuration |
NewtonsoftJsonParsingConfig.cs |
Added corresponding normalization configuration properties |
NormalizationNonExistingPropertyBehavior.cs |
New enum defining how to handle missing properties during normalization (both libraries) |
JsonValueInfo.cs |
Internal struct for tracking JSON value type and schema information (both libraries) |
JsonValueExtensions.cs |
Extension method for getting JsonValueKind on pre-.NET 8 platforms |
SystemTextJsonExtensions.cs |
Integrated normalization into the query pipeline |
NewtonsoftJsonExtensions.cs |
Integrated normalization into the query pipeline |
Comments suppressed due to low confidence (2)
test/System.Linq.Dynamic.Core.SystemTextJson.Tests/SystemTextJsonTests.cs:578
- This assignment to first is useless, since its value is never read.
var first = result.First();
test/System.Linq.Dynamic.Core.SystemTextJson.Tests/SystemTextJsonTests.cs:591
- This assignment to array is useless, since its value is never read.
var array = JsonDocument.Parse(data);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/System.Linq.Dynamic.Core.NewtonsoftJson/Config/NormalizationNonExistingPropertyBehavior.cs
Outdated
Show resolved
Hide resolved
src/System.Linq.Dynamic.Core.SystemTextJson/Config/SystemTextJsonParsingConfig.cs
Outdated
Show resolved
Hide resolved
src/System.Linq.Dynamic.Core.NewtonsoftJson/Config/NewtonsoftJsonParsingConfig.cs
Outdated
Show resolved
Hide resolved
src/System.Linq.Dynamic.Core.SystemTextJson/Utils/NormalizeUtils.cs
Outdated
Show resolved
Hide resolved
test/System.Linq.Dynamic.Core.SystemTextJson.Tests/SystemTextJsonTests.cs
Outdated
Show resolved
Hide resolved
…onNonExistingPropertyBehavior.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…sonParsingConfig.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…sonParsingConfig.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ls.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This was referenced Nov 17, 2025
This was referenced Dec 1, 2025
This was referenced Dec 15, 2025
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.